package cn.liuxiany.alibaba.common.exception;

import java.io.Serializable;

/**
 * @Description 通用异常类
 * @Author liuxiany
 * @Date 2023/10/31
 */
public class GenericException extends RuntimeException implements Serializable {
    private static final long serialVersionUID = 1;
    String expCode;
    String expMessage;

    public GenericException() {
        this.expCode = null;
        this.expMessage = null;
    }

    public GenericException(String message) {
        super(message);
        this.expCode = null;
        this.expMessage = null;
    }

    public GenericException(Exception oriEx) {
        super(oriEx);
        this.expCode = null;
        this.expMessage = null;
    }

    public GenericException(Throwable oriEx) {
        super(oriEx);
        this.expCode = null;
        this.expMessage = null;
    }

    public GenericException(String message, Exception oriEx) {
        super(message, oriEx);
        this.expCode = null;
        this.expMessage = null;
    }

    public GenericException(String message, Throwable oriEx) {
        super(message, oriEx);
        this.expCode = null;
        this.expMessage = null;
    }

    public GenericException(String expCode, String message, Throwable oriEx) {
        super(expCode + ":" + message, oriEx);
        this.expCode = null;
        this.expCode = expCode;
        this.expMessage = null;
    }

    public String getErrorCode() {
        return this.expCode;
    }

    public void setErrorCode(String expCode) {
        this.expCode = expCode;
    }

    public String getErrorMessage() {
        return this.expMessage;
    }

    public void setErrorMessage(String expMessage) {
        this.expMessage = expMessage;
    }
}